{% extends "admin.html" %}

{% block title %}The Living History: Users{% endblock %}

{% block mainheading %}Edit user: {{user.username}}{% endblock %}

{% block display %}

		<form action="/admin/editUser/{{user.username}}" method="post">
		<table>
	      <tr>
		    <td>Username:</td>
			<td><input type="Text" name="username" size="25" value="{{ user.username }}"></td>
		  </tr>
		  <tr>
			  <td>Google username:</td>
			  <td><input type="Text" name="google_username" value="{{ user.google_user.nickname }}"> @gmail.com</td>
		  </tr>
		  <tr>
		  	<td>Groups:</td>
			<td>
				<select name="groups" multiple>
 				{% for group in groups %}
					<option value="{{ group.name }}" 
					{% for usergroup in user.groups %} 
						{% ifequal group usergroup %}selected{% endifequal %}
					{% endfor %}
					>{{ group.name }}</option>
				{% endfor %}
				</select>

			</td>
		  <tr>
			<td>Permissions:</td>
			<td>[reserved]</td>
		  </tr>
		  <tr>
		  <td align="center" colspan="2"><input type="Submit" name="add" value="Add user data"></td>
		  </tr>
		</table>
		</form>
		</p>

{% endblock %}